package com.liu.yuoj.judge.codesandbox.factory;

import com.liu.yuoj.judge.codesandbox.CodeSandBox;
import com.liu.yuoj.judge.codesandbox.impl.ExampleCodeSandBox;
import com.liu.yuoj.judge.codesandbox.impl.RemoteCodeSandBox;
import com.liu.yuoj.judge.codesandbox.impl.ThirdCodeSandBox;


/**
 * @author 刘渠好
 * @since 2025-01-15 22:45
 * 代码沙箱工厂模式
 */
public class CodeSandBoxFactory {
    public static CodeSandBox getCodeSandBox(String name) {
        CodeSandBox codeSandBox;
        switch (name){
            case "Third":
                codeSandBox= new ThirdCodeSandBox ();
                break;
            case "Remote":
                codeSandBox= new RemoteCodeSandBox ();
                break;
            default:
                codeSandBox=new ExampleCodeSandBox ();
        }
        return codeSandBox;
    }

}
